package com.plian.system.wrapper.im;

import com.plian.system.dto.im.InvestmentDebtDTO;
import com.plian.system.entity.im.InvestmentDebt;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.im.InvestmentDebtVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.PROPERTY_ID_NAME;
import static com.plian.system.wrapper.util.WrapperConstant.SPRING;

/**
 * @description:
 * @author: gangan
 * @create: 2020-04-23 14:14
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface InvestmentDebtWrapper extends BaseWrapper<InvestmentDebt, InvestmentDebtDTO, InvestmentDebtVO> {
    /**
     * Entity转VO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mappings(value = {
            @Mapping(source = "projectCompanyId", target = "projectCompanyName", qualifiedByName = PROPERTY_ID_NAME)
    })
    InvestmentDebtVO entityToVO(InvestmentDebt entity);

}
